local skel = fk.CreateSkill {
  name = "emo__tanxian",
  tags = {Skill.Limited},
}

Fk:loadTranslationTable{
  ["emo__tanxian"] = "昙霰",
  [":emo__tanxian"] = "限定技，出牌阶段，你可以弃置花色各不相同的四张牌，结束回合并获得一个额外回合。洗牌后复原此技能。",
  ["#emo__tanxian"] = "弃置花色各不相同的四张牌，结束回合并获得一个额外回合",
}

skel:addEffect("active", {
  card_num = 4,
  prompt = "#emo__tanxian",
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryGame) == 0
  end,
  card_filter = function(self, player, to_select, selected)
    return #selected < 4 and not player:prohibitDiscard(to_select) and
      table.every(selected, function (id)
      return Fk:getCardById(to_select):compareSuitWith(Fk:getCardById(id), true)
    end)
  end,
  target_num = 0,
  on_use = function(self, room, effect)
    local player = effect.from
    room:throwCard(effect.cards, skel.name, player, player)
    if player.dead then return end
    room:endTurn()
    player:gainAnExtraTurn(true, skel.name)
  end,
})

skel:addEffect(fk.AfterDrawPileShuffle, {
  can_refresh = Util.TrueFunc,
  on_refresh = function(self, event, target, player, data)
    player:setSkillUseHistory(skel.name, 0, Player.HistoryGame)
  end,
})


return skel
